package com.arsl.server.db;

import java.io.IOException;
import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.arsl.client.data.Paper;

public class DBHandler {

	public static DBHandler self = null;
	public static SqlSessionFactory sqlSessionFactory;

	private DBHandler() throws IOException {
		String resource = "com/arsl/mybatis-config.xml";
		InputStream inputStream = null;
		inputStream = Resources.getResourceAsStream(resource);
		sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
	}

	public static DBHandler getInstance() {
		if (self == null) {
			try {
				self = new DBHandler();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return self;
	}

	public void function() {

	}
}
